<template>
<div>
     <!--用户列表区-->
  <el-table :data="contentList" height="450" style="width: 100%" border stripe>
      <el-table-column type="index"> </el-table-column>
      <el-table-column label="RoomID" prop="roomId"  > </el-table-column>
      <el-table-column label="日期" prop="sendTime"   > </el-table-column>
      <el-table-column label="sender" prop="sender"   > </el-table-column>
      <el-table-column label="reciever" prop="receiver"    > </el-table-column>
      <el-table-column label="Type" prop="type"  > </el-table-column>
      <el-table-column label="Content"  prop="content" width="480px"> </el-table-column>
  </el-table>
   
</div>
</template>
<script>
import {getContentList} from '../../util/api.js'

export default {
    data(){
        return{
         contentList:[],
         roomId:'',
         content:'',
         receiver:'',
         sendTime:'',
         sender:'',
         type:'',
        
        }
        },

    
    created()
    {
       this.token= window.sessionStorage.getItem('token')
        // console.log("OK")
        console.log( this.$route)
        this.roomId=this.$route.query.info.id
        this.getContentList()
    },
    methods:
    {
         async getContentList(){
          const result =await this.$http.post(getContentList,
          {
            'token':this.token,
            'roomId':this.$route.query.info.id
          }
          );
            console.log(result.data)
            if(result.status!==200) return this.$message.console.error("获取数据失败！");
            this.contentList=result.data.list
            this.$message.success("获取数据成功")        
      }

    }
    
}
</script>
<style lang="less" scoped>

</style>